package com.quarkus.resources;

import io.smallrye.mutiny.Uni;

import java.time.Duration;

/**
 * @Author: TongRui乀
 * @Date: 2020/12/5 18:05
 * @description：
 */
public class ApiTest {

    public static void main(String[] args) {

        test_01();

    }

    public static void test_01(){



        Uni<String> uni = Uni.createFrom().item("sdf ")
                .onItem().transform(String::strip)
                .ifNoItem().after(Duration.ofMillis(100)).recoverWithUni((()-> Uni.createFrom().item("hhh")));

        System.out.println(uni.await().atMost(Duration.ofSeconds(1)));
    }




}
